<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:mumu="http://java.sun.com/jsf/composite/mumu">
    <rich:dataTable id="ModuleList" value="#{moduleBean.moduleList}" var="record" keepSaved="true"
                    iterationStatusVar="it" rows="15">
        <f:facet name="header">
            <rich:columnGroup>
                <rich:column breakRowBefore="true">#{msg['module.name']}</rich:column>
                <rich:column >#{msg['operate.sign']}</rich:column>
                <rich:column >#{msg['module.url']}</rich:column>
                <rich:column>#{msg['createTime']}</rich:column>
                <rich:column>#{msg['updateTime']}</rich:column>
                <rich:column>#{msg['table.action']}</rich:column>
            </rich:columnGroup>
        </f:facet>
        <rich:column>
            <rich:collapsibleSubTableToggler for="Module_Operate"/>
            <h:outputText id="moduleName" value="#{record.moduleName}"/>
        </rich:column>
        <rich:column>

        </rich:column>
        <rich:column>
            <h:outputText id="moduleURL" value="#{record.moduleUrl}"/>
        </rich:column>
        <rich:column>
            <h:outputText id="moduleCreateTime" value="#{record.createTime}" converter="longDateConverter"/>
        </rich:column>
        <rich:column>
            <h:outputText id="moduleUpdateTime" value="#{record.updateTime}" converter="longDateConverter"/>
        </rich:column>
        <rich:column>
            <a4j:commandLink value="#{msg['link.add']}#{msg['operate']}" action="#{moduleBean.popupAddOperate}"
                             render="editModuleGroup" oncomplete="PawnPopup.show('ModulePopupAddOrEdit')"
                             limitRender="true">
                <f:setPropertyActionListener value="#{record}" target="#{moduleBean.module}"/>
            </a4j:commandLink>
            <a4j:commandLink value="#{msg['link.Edit']}" action="#{moduleBean.popupModuleEdit}"/>
        </rich:column>
        <rich:collapsibleSubTable keepSaved="true" id="Module_Operate"
                                  expanded="true" expandMode="client"
                                  value="#{record.operates}" var="operate"
                                  rowClasses="odd-row,even-row"
                                  style="padding-top:5px;padding-left:5px;">
            <rich:column>
                <h:outputText id="name" value="#{operate.operateName}" style="padding-left: 20px;"/>
            </rich:column>
            <rich:column>
                #{operate.operateSign}
            </rich:column>
            <rich:column>
                #{operate.operateAction}
            </rich:column>
            <rich:column>
                <mumu:timeOutput value="#{operate.createTime}"/>
            </rich:column>
            <rich:column>
                <mumu:timeOutput value="#{operate.updateTime}"/>
            </rich:column>
            <rich:column>
                <a4j:commandLink value="#{msg['link.Edit']}"/>
                <mumu:removeLink 
                                 title="#{msg['action.delete']}"/>

            </rich:column>
        </rich:collapsibleSubTable>
    </rich:dataTable>
    <mumu:confirmAction render="Module_Operate@body" msg="#{msg['delete.msg']}"
                        faction="#{moduleBean.remove}" popupId="OperateDelete"/>
    <mumu:confirmAction render="ModuleList@body" faction="#{moduleBean.removeModule}" msg="#{msg['delete.msg']}"/>
</ui:composition>